home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / video / zapem-0.000 / zapem-0 / zapem / sprite.h < prev    next >
C/C++ Source or Header  |  1995-04-01  |  2KB  |  73 lines

  1. /* C++ wrapper for assembler block copy routines */
  2.  
  3. #ifndef SPRITE_H
  4. #define SPRITE_H
  5.  
  6. #include "btypes.h"
  7.  
  8. #include <SLList.h>
  9. #include "animation.h"
  10. #include "screen.h"
  11.  
  12. class
  13. Sprite : public Animation, public Screen
  14. {
  15. private:
  16.     void copy(const Sprite& s);
  17. protected:
  18.     byte *backmem, *maskmem, *blockmem;
  19.  
  20.     static SLList<Sprite*> vlist;
  21.     static SLList<Sprite*> appearlist;
  22.     static SLList<Sprite*> disappearlist;
  23.     
  24.         uint32 width,height,ByteLength;
  25.     int xp,yp,oldxp,oldyp;
  26.     int deltax,deltay;        /* used to show size of move */
  27.     bool visibleflag;
  28.  
  29.     void MakeMask(byte maskcolour=0);
  30.     void Transpaste( void );
  31.     void CutBack( void );
  32. public:
  33.     Sprite();
  34.     Sprite(const Sprite& s);
  35.     ~Sprite();
  36.     Sprite& operator=(const Sprite& s);
  37.  
  38.     void gifLoadAndCut(char *filename, int slot);
  39.     void Cut(uint32 x1, uint32 y1, uint32 xw, uint32 yw, int slot);
  40.     void Paste(uint32 x1, uint32 y1);
  41.     void Recut(uint32 x1, uint32 y2);
  42.     void Update(){ Update(xp,yp); }
  43.     void Update( int x1, int y1);
  44.     void UpdateAll(void);
  45.     void ReplaceAll(void);
  46.     void PasteAll(void);
  47.     void getAll(void);
  48.     void hideAll(void);
  49.     void move( int x1, int y1){ xp=xp+x1;yp=yp+y1;}
  50.     void move( void){ xp=xp+deltax;yp=yp+deltay;}
  51.     void getBack(uint32 x1, uint32 y1);
  52.     void getBack(void){ getBack(xp,yp); }
  53.     void fixBack( void );
  54.     bool collide(const Sprite& s);
  55.     void appear(void);
  56.     void disappear(void);
  57.  
  58.     inline int getXp(void) const { return xp; }
  59.     inline int getYp(void) const { return yp; }
  60.     inline int getDeltaX(void) const { return deltax;}
  61.     inline int getDeltaY(void) const { return deltay;}
  62.     inline bool getVisible(void) const { return visibleflag;}
  63.         inline int getHeight(void) const { return height;}
  64.         inline int getWidth(void) const { return width;}
  65.  
  66.     void setSlot( int slot);
  67.     void setVisible( bool v);
  68.     inline void setDelta( int x1, int y1) { deltax=x1; deltay=y1;}
  69.     inline void setPos( int x1, int y1) { xp=x1; yp=y1;}
  70. };
  71.  
  72. #endif
  73.